package com.mdd.admin.validate.order;

import com.mdd.admin.validate.BaseParam;
import com.mdd.common.validator.annotation.IDMust;
import com.mdd.common.validator.annotation.IntegerContains;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import lombok.Data;
import javax.validation.constraints.*;
import java.math.BigDecimal;

/**
 * 用户账户记录参数
 * @author panweiliang
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class AccountLogParam extends BaseParam {

    @IDMust(message = "id参数必传且需大于0", groups = {update.class, delete.class})
    private Integer id;

    @NotNull(message = "sn参数缺失", groups = {create.class, update.class})
    @Length(max = 32, message = "sn参数不能超出32个字符", groups = {create.class, update.class})
    private String sn;

    @NotNull(message = "userId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "userId参数值不能少于0", groups = {create.class, update.class})
    private Integer userId;

    @NotNull(message = "changeType参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "changeType参数值不能少于0", groups = {create.class, update.class})
    private Integer changeType;

    @NotNull(message = "action参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "action参数值不能少于0", groups = {create.class, update.class})
    private Integer action;

    @NotNull(message = "changeAmount参数缺失", groups = {create.class, update.class})
    private BigDecimal changeAmount;

    @NotNull(message = "leftAmount参数缺失", groups = {create.class, update.class})
    private BigDecimal leftAmount;

    @NotNull(message = "associationSn参数缺失", groups = {create.class, update.class})
    @Length(max = 255, message = "associationSn参数不能超出255个字符", groups = {create.class, update.class})
    private String associationSn;

    @NotNull(message = "remark参数缺失", groups = {create.class, update.class})
    @Length(max = 255, message = "remark参数不能超出255个字符", groups = {create.class, update.class})
    private String remark;

    private String feature;

}
